-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix null DataList
issue + other null-safety concerns
#86
base: null-safety
Are you sure you want to change the base?
Conversation
DataList
issue + other null-safety concernsDataList
issue + other null-safety concerns
@@ -87,9 +82,9 @@ class TagsState extends State<Tags> { | |||
Orientation _orientation = Orientation.portrait; | |||
double _width = 0; | |||
|
|||
final List<DataList> _list = []; | |||
final List<DataList?> _list = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the fix to #79
It worked! Why has this not been merged yet? |
cc @Dn-a 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe some files could be deleted and added to .gitignore
. Look an example.
example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
Outdated
Show resolved
Hide resolved
@@ -438,9 +439,9 @@ class _ItemTagsState extends State<ItemTags> { | |||
void _singleItem(DataListInherited dataSetIn, DataList? dataSet) { | |||
dataSetIn.list! | |||
.where((tg) => tg != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid use of !
.
.where((tg) => tg != null) | |
..whereNotNull() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks but my IDE complains when using whereNotNull
, as if it didn't exist...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, it is an extension method from the collection package and it is not used in this package, I'm sorry. (and sorry for the very long delay)
pubspec.lock
Outdated
@@ -7,49 +7,49 @@ packages: | |||
name: async | |||
url: "https://pub.dartlang.org" | |||
source: hosted | |||
version: "2.5.0-nullsafety.3" | |||
version: "2.8.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not recommended commit this file in libraries
so how do we use this if this has not been merged yet ?! |
@tony123S, sorry for the delay, I think you already did it, but if anyone needs it too:
|
This PR fixes #79 and addresses all the other null-safety warnings.
Version proposed:
1.0.1